home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / ISSUE02 / XTOOLS / XTOOL.ZIP / REMEMBER.INT < prev    next >
Encoding:
Text File  |  1995-05-28  |  1.8 KB  |  52 lines

  1. {*******************************************************}
  2. {                                                       }
  3. {       xTool - Component Collection                    }
  4. {                                                       }
  5. {       Copyright (c) 1995 Stefan B÷ther                }
  6. {                                                       }
  7. {*******************************************************}
  8. unit Remember;
  9.  { remember various attributes of the owning form }
  10.  
  11. interface
  12.  
  13. uses
  14.   WinTypes, WinProcs, SysUtils, Classes, Graphics, Dialogs, Forms, IniFiles;
  15.  
  16. type
  17.   TRememberOption  = (roPosition,roSize,roColor,roFont);
  18.   TRememberOptions = set of TRememberOption;
  19.  
  20.   TRemember = class(TComponent)
  21.   private
  22.     FIniFile    : PString;
  23.     FSection    : PString;
  24.     FOnWrite    : TNotifyEvent;
  25.     FOnRead     : TNotifyEvent;
  26.     FNextDestroy: TNotifyEvent;
  27.     FOptions    : TRememberOptions;
  28.     function    GetIniFile: String;
  29.     function    GetSection: String;
  30.     procedure   SetIniFile(Value: String);
  31.     procedure   SetSection(Value: String);
  32.     procedure   WriteRead(IsRead: Boolean);
  33.     procedure   FormDestroy(Sender:TObject);
  34.   protected
  35.     FStorage    : TIniFile;
  36.     procedure   ReadState(Reader: TReader); override;
  37.   public
  38.     constructor Create(aOwner:TComponent); override;
  39.     destructor  Destroy; override;
  40.     procedure   Write; virtual;
  41.     procedure   Read; virtual;
  42.   published
  43.     property    IniFile: String read GetIniFile write SetIniFile;
  44.     property    Section: String read GetSection write SetSection;
  45.     property    Options: TRememberOptions read FOptions write FOptions;
  46.     property    OnWrite: TNotifyEvent read FOnWrite write FOnWrite;
  47.     property    OnRead: TNotifyEvent read FOnRead write FOnRead;
  48.   end;
  49.  
  50.   procedure Register;
  51.  
  52.